import request from '@/utils/request'

// 查询患者住院预交金列表 (分页)
export function selectPagePatPrepayment(query) {
    return request({
        url: '/business/patPrepayment/selectPage',
        method: 'get',
        params: query
    })
}

// 查询患者住院预交金列表 (不分页)
export function listPatPrepayment(query) {
    return request({
        url: '/business/patPrepayment/list',
        method: 'get',
        params: query
    })
}

// 查询患者住院预交金详细
export function getPatPrepayment(prepaymentId) {
    return request({
        url: '/business/patPrepayment/' + prepaymentId,
        method: 'get'
    })
}

// 新增患者住院预交金
export function addPatPrepayment(data) {
    return request({
        url: '/business/patPrepayment',
        method: 'post',
        data: data
    })
}

// 修改患者住院预交金
export function updatePatPrepayment(data) {
    return request({
        url: '/business/patPrepayment',
        method: 'put',
        data: data
    })
}

// 删除患者住院预交金
export function delPatPrepayment(prepaymentId) {
    return request({
        url: '/business/patPrepayment/' + prepaymentId,
        method: 'delete'
    })
}

export function refundApplication(prepaymentId, type, userLoginId) {
    return request({
        url: '/business/patPrepayment/refundApplication/' + prepaymentId + '/' + type + '/' + userLoginId,
        method: 'delete'
    })
}

// 获取预交金结账页面综合信息（用于结账查询）
export function getPatPrepayCostAndTotal(query) {
    return request({
        url: "/business/patPrepayment/getPatPrepayCostAndTotal",
        method: "get",
        params: query,
    });
}
